package com.wctj.api.business.common.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wctj.api.base.entity.DdwxAdminSetappMp;
import com.wctj.api.base.utils.InstanceConvertUtil;
import com.wctj.api.business.common.dao.DdwxAdminSetappMpMapper;
import com.wctj.api.business.common.dto.DdwxAdminSetappMpDTO;
import com.wctj.api.business.common.service.DdwxAdminSetappMpService;
import org.springframework.stereotype.Service;

/**
 * 微信众号
 */
@Service
public class DdwxAdminSetappMpServiceImpl extends ServiceImpl<DdwxAdminSetappMpMapper, DdwxAdminSetappMp> implements DdwxAdminSetappMpService {

    @Override
    public DdwxAdminSetappMpDTO findOneByPayType(int payType) {
        DdwxAdminSetappMp setappApp = new LambdaQueryChainWrapper<>(baseMapper)
                .eq(DdwxAdminSetappMp::getWxpay, payType)
                .one();
        return InstanceConvertUtil.convertObject(setappApp, DdwxAdminSetappMpDTO.class);
    }
}
